package com.eipc.view;

import android.content.Context;
import android.content.res.Resources;
import android.view.LayoutInflater;
import android.widget.TextView;

import com.eipc.R;
import com.eipc.event.TagValue;

/**
 * 文字图片按钮
 * @author x_liaolijun
 */
public class TextImageButton{
	
	public TextImageButton(Context context,int imgId,String txt,TagValue tagValue){
		Resources re = context.getResources();
		mContext = context;
		LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		mTextView = (TextView)inflater.inflate(R.layout.textimageview, null);
		mTextView.setCompoundDrawablesWithIntrinsicBounds(0, imgId, 0, 0);
	    mTextView.setCompoundDrawablePadding(re.getDimensionPixelOffset(R.dimen.drawable_text_padding));
	    mTextView.setText(txt);
	    mTextView.setTag(tagValue);
	}
	
	public TextView getView(){
		return mTextView;
	}

	private TextView mTextView;
	private Context mContext;
}
